this._appsStale = true;
this._appSystem.connect('installed-changed', Lang.bind(this, function(appSys) {
this._appsStale = true;
- this._redisplay(0);
- this._redisplayMenus();
+ this._redisplay(GenericDisplay.RedisplayFlags.NONE);
}));
this._appSystem.connect('favorites-changed', Lang.bind(this, function(appSys) {
- this._redisplay(0);
+ this._appsStale = true;
+ this._redisplay(GenericDisplay.RedisplayFlags.NONE);
}));
this._appMonitor.connect('app-added', Lang.bind(this, function(monitor) {
- this._redisplay(0);
+ this._appsStale = true;
+ this._redisplay(GenericDisplay.RedisplayFlags.NONE);
}));
this._appMonitor.connect('app-removed', Lang.bind(this, function(monitor) {
- this._redisplay(0);
+ this._appsStale = true;
+ this._redisplay(GenericDisplay.RedisplayFlags.NONE);
}));
- // Load the apps now so it doesn't slow down the first
- // transition into the Overview
- this._refreshCache();
-
this._focusInMenus = true;
this._activeMenuIndex = -1;
this._activeMenu = null;
this._menuDisplay = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL,
spacing: MENU_SPACING
});
- this._redisplayMenus();
this.connect('expanded', Lang.bind(this, function (self) {
this._filterReset();
this._activeMenuApps = this._appSystem.get_applications_for_menu(id);
}
}
- this._redisplay(true);
+ this._redisplay(GenericDisplay.RedisplayFlags.FULL);
}));
this._menuDisplay.append(display.actor, 0);
},
this._addApp(app);
}
}
+ this._redisplayMenus();
}
this._appsStale = false;
// but redisplaying right away is cool when we use Zephyr.
// Also, we might be displaying remote documents, like Google Docs, in the future
// which might be edited by someone else.
- this._redisplay(false);
+ this._redisplay(GenericDisplay.RedisplayFlags.NONE);
}));
this.connect('destroy', Lang.bind(this, function (o) {
//// Protected methods ////
- _redisplayFull: function() {
+ _recreateDisplayItems: function() {
this._removeAllDisplayItems();
+ this._setDefaultList();
for (let itemId in this._allItems) {
this._addDisplayItem(itemId);
}
},
// Creates a display item based on the information associated with itemId
- // and adds it to the displayed items.
+ // and adds it to the list of displayed items, but does not yet display it.
_addDisplayItem : function(itemId) {
if (this._displayedItems.hasOwnProperty(itemId)) {
log("Tried adding a display item for " + itemId + ", but an item with this item id is already among displayed items.");
this.emit('show-details', index);
}
}));
- this._list.add_actor(displayItem.actor);
this._displayedItems[itemId] = displayItem;
},
* their own while the user was browsing through the result pages.
* SUBSEARCH - Indicates that the current _search is a superstring of the previous
* one, which implies we only need to re-search through previous results.
+ * FULL - Indicates that we need refresh all displayed items.
*/
_redisplay: function(flags) {
let resetPage = (flags & RedisplayFlags.RESET_CONTROLS) > 0;
let fullReload = (flags & RedisplayFlags.FULL) > 0;
let hadSelected = this.hasSelected();
+ this.unsetSelected();
+
+ if (!this._initialLoadComplete)
+ fullReload = true;
- if (!this._initialLoadComplete || !this._refreshCache())
+ if (!this._refreshCache())
fullReload = true;
+
if (fullReload) {
+ this._recreateDisplayItems();
this._initialLoadComplete = true;
- this._redisplayFull();
- } if (isSubSearch) {
+ }
+
+ if (isSubSearch) {
this._redisplaySubSearch();
} else {
this._redisplayReordering();